package android.loaders;

import java.io.InputStream;
import java.util.List;

import android.content.Context;
import android.content.res.Resources;
import android.model.BankItemDialogue;
import android.xml.BankHandlerDialogue;
import android.xml.ItemsParser;
import android.activity.R;

public class ShopLoaderDialogue implements ILoader<BankItemDialogue> {

	Resources res;

	public ShopLoaderDialogue(Context ctx) {
		res = ctx.getResources();
	}
	
	/*
	 * (non-Javadoc)
	 * @see android.loaders.ILoader#load()
	 * vo lista se cita xml dokumentot od kade gi zemame podatocite
	 */
	@SuppressWarnings("unchecked")
	public List<BankItemDialogue> load() throws Exception {
		InputStream is = res.openRawResource(R.raw.dial_shop);
		return (List<BankItemDialogue>) ItemsParser.parse(is, new BankHandlerDialogue());
	}
}
